package com.neusoft.movie.v_movies.model;

import com.neusoft.movie.v_movies.common.Constants;
import com.neusoft.movie.v_movies.listener.RetrofitListener;
import com.neusoft.movie.v_movies.service.MoviesService;
import com.neusoft.movie.v_movies.service.UsersService;

import retrofit2.Call;

/**
 * Created by Administrator on 2018/1/5.
 */

public class UsersModel extends RetrofitBaseModel {
    private UsersService usersService;

    public UsersModel() {
        this.usersService = retrofit.create(UsersService.class);
    }

    //登录
    public void getUserLogin(String u_phone,String u_pass,RetrofitListener listener) {
        Call call = usersService.getUserLogin(u_phone,u_pass);
        bindCallback(call, listener, Constants.GETUSERLOGIN);
    }

    //注册
    public void getUserRegister(String u_name,String u_phone,String u_pass,String u_email,String address,String u_personal,RetrofitListener listener) {
        Call call = usersService.getUserRegister(u_name,u_phone,u_pass,u_email,address,u_personal);
        bindCallback(call, listener, Constants.GETUSERREGISTER);
    }


   //收藏
    public void addcollect(int u_id, int collect_id, int collect_flag, final RetrofitListener listener){
        Call call = usersService.addcollect(u_id,collect_id,collect_flag);
        bindCallback(call,listener,Constants.ADDCOLLECT);
    }

   //评论
    public void addcomments(int u_id, int comment_id, int comment_flag,String com_content, final RetrofitListener listener){
        Call call = usersService.addcomments(u_id,comment_id,comment_flag,com_content);
        bindCallback(call,listener,Constants.ADDCOMMENTS);
    }

    //查看个人信息
    public void getUserInfo(int u_id,RetrofitListener listener) {
        Call call = usersService.getUserInfo(u_id);
        bindCallback(call, listener, Constants.GETUSERINFO);
    }

    //关于我们APP
    public void aboutme(RetrofitListener listener) {
        Call call = usersService.aboutme();
        bindCallback(call, listener, Constants.ABOUTME);
    }


    //发表反馈
    public void addfeedback(int u_id,String f_info,RetrofitListener listener) {
        Call call = usersService.addfeedback(u_id,f_info);
        bindCallback(call, listener, Constants.ADDDEEDBACK);
    }


    //我的文章列表
    public void getMyArticleslist(int u_id,RetrofitListener listener) {
        Call call = usersService.getMyArticleslist(u_id);
        bindCallback(call, listener, Constants.GETMYARTICLESLIST);
    }


    //我收藏的文章列表
    public void mycolart(int u_id,int collect_flag,RetrofitListener listener) {
        Call call = usersService.mycolart(u_id,collect_flag);
        bindCallback(call, listener, Constants.MYCOLLECTARTICLES);
    }

    //我收藏的电影列表
    public void mycolmovies(int u_id,int collect_flag,RetrofitListener listener) {
        Call call = usersService.mycolmovies(u_id,collect_flag);
        bindCallback(call, listener, Constants.MYCOLLECTMOVIES);
    }

    //我收藏的作者列表
    public void mycolusers(int u_id,int collect_flag,RetrofitListener listener) {
        Call call = usersService.mycolusers(u_id,collect_flag);
        bindCallback(call, listener, Constants.MYCOLLECTUSERS);
    }

    //修改个人信息
    public void updateuser(int u_id,
                           String u_name,
                           String u_phone,
                           String u_email,
                           String u_address,
                           String u_pwd,RetrofitListener listener) {
        Call call = usersService.updateuser(u_id,u_name,u_phone,u_email,u_address,u_pwd);
        bindCallback(call, listener, Constants.UPDATEUSER);
    }

    //修改个性签名
    public void updateuserpersonal(int u_id,
                           String u_personal,RetrofitListener listener) {
        Call call = usersService.updateuserpersonal(u_id,u_personal);
        bindCallback(call, listener, Constants.UPDATEUSERPERSONAL);
    }


    //查看我报名的活动
    public void getMyActOrderlist(int u_id,RetrofitListener listener) {
        Call call = usersService.getMyActOrderlist(u_id);
        bindCallback(call, listener, Constants.GETMYORDERLIST);
    }


//    //查看我报名成功的活动
//    public void getMyLuckyActOrderlist(int u_id,RetrofitListener listener) {
//        Call call = usersService.getMyLuckyActOrderlist(u_id);
//        bindCallback(call, listener, Constants.GETMYLUCKYACTORDERLIST);
//    }

    //查看我报名的活动的详情
    public void getMyActOrderdetail(int u_id,int act_id,RetrofitListener listener) {
        Call call = usersService.getMyActOrderdetail(u_id,act_id);
        bindCallback(call, listener, Constants.GETMYENTERACTDETAIL);
    }



}
